package com.plian.system.dao.fr.indicatorswarning;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.model.page.Page;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class IndicatorsWarningDao {
    @Resource(name = "daoSupport")
    private DaoSupport dao;
    /**
     * 列表
     * @return
     * @throws Exception
     */
    public List<PageData> listPage(Page page) throws Exception {
        return (List<PageData>) dao.findForList("IndicatorsWarningMapper.listPage",page);
    }
    /**
     * 列表
     * @return
     * @throws Exception
     */
    public List<PageData> listMonthPage(Page page) throws Exception {
        return (List<PageData>) dao.findForList("IndicatorsWarningMapper.listMonthPage",page);
    }
    /**
     更新当月数据
     */
    public void update(PageData pd) throws Exception {
        dao.update("IndicatorsWarningMapper.update",pd);
    }

    /**
     添加银行预警
     */
    public void insertWarn(PageData pd) throws Exception {
        dao.save("IndicatorsWarningMapper.insertWarn",pd);
    }

    /**
     * 更新银行预警
     * @param pd
     * @throws Exception
     */
    public void updateWarn(PageData pd) throws Exception {
        dao.update("IndicatorsWarningMapper.updateWarn",pd);
    }

    /**
     * 查找银行预警
     * @param pd
     * @return
     * @throws Exception
     */
    public PageData selectWarn(PageData pd)throws Exception{
        return (PageData)dao.findForObject("IndicatorsWarningMapper.selectWarn",pd);
    }
}
